#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2018/9/17 16:49
# @Author  : youfeng
from config.mongo_conf import AppDataConfig
from common.mongo import MongDb
from logger import AppLogger

log = AppLogger('mongo_demo.log').get_logger()
app_data_db = MongDb(AppDataConfig.HOST, AppDataConfig.PORT, AppDataConfig.DB,
                     AppDataConfig.USERNAME,
                     AppDataConfig.PASSWORD, log=log)


def main():
    for item in app_data_db.traverse_batch_field("enterprise_data_gov", {}, {"_id": False,
                                                                             "_src": False,
                                                                             "_in_time": False,
                                                                             "_utime": False,
                                                                             "_record_id": False,
                                                                             "company": False}):
        log.info(item)


if __name__ == '__main__':
    main()
